const { defineConfig } = require('@vue/cli-service')
const define = require('./src/utils/define.js')

const webpack = require("webpack");

module.exports = defineConfig({
  // 打包公用路径配置
  publicPath: '/',
  transpileDependencies: true,
  // 关闭 eslint 保存时校验
  lintOnSave: false,
  devServer: {
    open: true,
    port: '9527',
    proxy: {
      '/dev': {
        target: define.APIURL,
        changeOrigin: true,
        pathRewrite: {
          '^/dev': ''
        }
      }
    }
  },
  // 解决 引入quill-image-resize-module 插件报错： Uncaught TypeError: Cannot read properties of undefined (reading 'imports')
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        "window.Quill": "quill/dist/quill.js",
        Quill: "quill/dist/quill.js",
      }),
    ],
  }
})
